#include<stdio.h>

int main()
{
    FILE* fp=fopen("file.txt","a");
    if(fp==NULL)
    {
        perror("fopen");
        return -1;
    }
    const char* append_bf="hello world!";
    int cnt=5;
    while(cnt--)
    {
        fprintf(fp,"%d:%s\n",cnt,append_bf);
    }
    fclose(fp);
    return 0;
}
